<?php
namespace app\admin\controller;
use think\Controller;
class Common extends Controller
{
	public $config;

    public function _initialize()
    {	

    	//获取控制器名称
    	$request = request();
    	$con=$request->controller();
    	$action=$request->action();
    	$this->assign('con',$con);
    	$this->getConf();
    	//dump($this->config);die;

    }
    //获取配置列表信息分配到个控制器模板中
    public function getConf(){
    	$confRes=array();
    	$_confRes=db('config')->field('enname,value')->select();
    	foreach ($_confRes as $k => $v) {
    		$confRes[$v['enname']]=$v['value'];
    	}
    	$this->config=$confRes;
    }
}
